import axios from '../utils/axios'
import api from '../api/index'

const getAllEstimate = () => {
    return new Promise((reslove, reject) => {
        axios.get(api.estimateApi.Appraise_getAll)
            .then(res => {
                reslove(res.data)
            })
            .catch(err => reject(err))
    })
}
const addEstimate = (args) => {
    return new Promise((resolve, reject) => {
        axios.post(api.estimateApi.Appraise_add, args)
            .then(res => {
                resolve(res.data)
            })
            .catch(err => reject(err))
    })
}
const deleteEstById = (id) => {
    return new Promise((resolve, reject) => {
        axios.post(api.estimateApi.Appraise_deleteById , { id })
            .then(res => {
                resolve(res.data)
            })
            .catch(err => reject(err))
    })
}

export default {
    getAllEstimate,
    addEstimate,
    deleteEstById,
}